EMT Practice Test

1. Question Content...


Question List

Question1: During the order of execution of a Visualforce page GET request, what happens after this step? Evaluate constructors on controllers and extensions

Question2: Consider the following code snippet:
A developer created the following test class to provide the proper code coverage for the snippet above:
However, when the test runs, no data is returned and the assertion fails.
However, when the test runs, no data is returned and the assertion fails.
Which edit should the developer make to ensure the test class runs successfully?

Question3: A developer receives an error when trying to call a global server-side method using the @remoteAction decorator. How can the developer resolve the error?

Question4: What tool in the Developer Console contains information on SOQL query Cardinality?

Question5: A developer created a custom component to display an HTML table. The developer wants to be able to use the component on different Visualforce Pages and specify different header text for the table.
Which tag should the developer use inside the component?

Question6: Which of the following about Dynamic Apex is incorrect?

Question7: A developer is building a Visualforce page that interacts with external services.
Which interface should the developer implement to test this functionality? (Choose two.)

Question8: Which statement is true regarding savepoints?

Question9: What is the transaction limit for the number of records for SOQL queries?

Question10: A developer created three Rollup Summary fields: Total_timesheets_c, Total_Approved_timesheet_c and Total_project_Timesheet_c in the custom object, project _c Now, the developer is tasked with created a new field to show the ratio between and approved

Question11: A developer needs to implement a system audit feature that allows users, assigned to a custom profile named "Auditors", to perform searches against the historical records in the Account object. The developer must ensure the search is able to return history records that are between 12 and 24 months old.
Given the code below, which select statement should be inserted below as a valid way to retrieve the Account History records ranging from 12 to 24 month old?
A)

B)

C)

D)

Question12: What are three benefits of using static resources in Visualforce and Lightning Components? Choose 3 answers

Question13: A Lightning Component functions in preview mode and needs to be used inside a Lightning App Builder page, but it is not available. What change should be applied to the component?

Question14: Refer to the code snippet below:

A custom object called Credit_Memo_c exist in a Salesforce environment. As part of a new feature development that retrieves and manipulates this type of record, the developer needs to ensure race conditions are prevented when a set of records are modified within an Apex transaction.
In the preceding Apex code, how can the developer alter the query statement to use SOQL features to prevent race condition within a transaction?
A)

B)

C)

D)

Question15: In an organization that has multi-currency enabled, a developer is tasked with building a Lighting Component that displays the top ten Opportunities most recently access by the logged in user. The developer must ensure the Amount and LastModifiedDate field values are displayed according to the user's locale.
What is the most effective approach to ensure values displayed respect the users locale settings?

Question16: A developer wrote a trigger on Opportunity that will update a custom Last Sold Date field on the Opportunity's Account whenever an Opportunity is dosed. In the test class for the trigger, the assertion to validate the Last Sold Date field fails.
What might be causing the failed assertion?

Question17: A company's support process dictates that any time a Case is closed with a Status of 'Could not fix,' an Engineering Review custom object record should be created and populated with information from the Case, the Contact, and any of the Products associated with the Case. What is the correct way to automate this using an Apex trigger?

Question18: Which is a valid Apex REST Annotation? (Choose two.)

Question19: A developer has a Batch Apex process, Batch_Account_Sales, that updates the sales amount for 10,000 Accounts on a nightly basis. The Batch Apex works as designed In the sandbox. However, the developer cannot get code coverage on the Batch Apex class.
The test class is below:

What is causing the code coverage problem?

Question20: A company has a custom object. Request__c. that has a field, Completed__c. and a Lookup to Opportunity, Opportunity__c.
Which SOQL query will get a unique list of all of the Opportunity records that have a Completed Request?

Question21: Consider the above trigger intended to assign the Account to the manager of the Account''s region. Which two changes should a developer make in this trigger to adhere to best practices? Choose 2 answers

Question22: A developer is creating a Lightning web component that can be added to a Lightning App Page and displayed when the page Is rendered in desktop and mobile phone format. To ensure a great mobile experience, the developer chooses to use the SLDS grid utility.
Which two Lighting web components should the developer implement to ensure the application Is mobile-ready? Choose 2 answers

Question23: The test method above tests an Apex trigger that the developer knows will make a lot of queries when a lot of Account are simultaneously updated to be customer.
The test method fails at the Line 20 because of too many SOQL queries
What is the correct way to fix this?

The test method above tests an Apex trigger that the developer knows will make a lot of queries when a lot of Accounts are simultaneously updated to be customers.
The test method fails at the Line 20 because of too many SOQL queries.
What is the correct way to fix this?

Question24: What Salesforce tool lets you deploy/retrieve metadata, check status of apex jobs, and check responses of REST calls?

Question25: Which three approaches should a developer Implement to obtain the best performance for data retrieval when building a Lightning web component?
Choose 3 answers

Question26: An org has a requirement that an Account must always have one and only one Contact listed as Primary. So selecting one Contact will de-select any others. The client wants a checkbox on the Contact called 'Is Primary' to control this feature. The client also wants to ensure that the last name of every Contact is stored entirely in uppercase characters. What is the optimal way to implement these requirements?

Question27: What is a consideration when testing batch Apex? (Choose two.)

Question28: A developer is tasked with creating a Lightning web component that is responsive on various devices.
which two components should help accomplish this goal?
Choose 2 answers

Question29: A company has a web page that needs to get Account record information, given its Salesforce record ID, from JavaScript on the page and then display it. Which method of integration is optimal?

Question30: Consider the following code snippet:

The Apex method is executed in an environment with a large data volume count for Accounts, and the query Is performing poorly.
Which technique should the developer Implement to ensure the query performs optimally, while preserving the entire result set?

Question31: A developer creates an application event that has triggered an infinite loop. What may have caused this problem?

Question32: An org has a custom object, Registeration_c that has a lookup relationship to the Opportunity object.
What should a developer use to create a stand-alone Vlsualforce page that displays the Registration__c records related to an Opportunity.

Question33: What is the transaction limit for the number of DML statements allowed?

Question34: A developer is inserting, updating, and deleting multiple lists of records in a Single transaction and wants to ensure that any error prevents all execution.
How should the developer implement error exception handling in their code to handle this?

Question35: This sales team needs a custom Visualforce page to enter sales orders. When a product is selected on the Visualforce page, a web service is invoked to determine if the product is in stock, and the result is displayed on the page.
How can a developer write this page to display the result of the web service and ensure governor limits for concurrent usage are not exceeded?

Question36: A user receives the generic "An internal server error has occurred" while interacting with a custom Lightning Component. What should the developer do to ensure a more meaningful message?

Question37: In which of the following scenarios would it be acceptable to use programmatic sharing instead of declarative sharing? (Choose three.)

Question38: A company wants to run different logic based on an Opportunity's record type. Which code segment handles this request and follows best practices?
A)

B)

Question39: Which technique can run logic when an Aura Component is loaded?

Question40: Universal Containers decided to use Salesforce to manage a new hire interview process. A custom object called candidate as created with organization-wide default set to Private. A lookup on the Candidate object sets an employee as an the viewer user

Question41: Universal Containers wants to use an external Web Service provided by a third-party vendor to validate that shipping and billing addresses are correct. The current vendor uses basic password authentication, but Universal Containers might switch to a different vendor who uses OAuth. What would allow Universal Containers to switch vendors without updating the code to handle authentication?

Question42: The "Webservice" keyword___________.

Question43: A corporation has many different Salesforce orgs, with some different objects and some common objects, and wants to build an application that can create, retrieve, and update common object records in all of the different orgs.
Which method of integration should the application use?

Question44: Consider the following queries. For these queries, assume that there are more than 200,000 Account records. These records include soft-deleted records; that is, deleted records that are still in the Recycle Bin. Note that there are two fields that are marked as External Id on the Account. These fields are Customer_Number__c and ERP_Key__c.
Which two queries are optimized for large data volumes? Choose 2 answers

Question45: As part of a new integration, a developer is asked to implement a new custom search functionality that is capable of performing unrestricted queries and can account for all values within a custom picklist field, type__z, on the Opportunity object. The search feature must also account for NULL values.
The organization-wide default for the Opportunity object is set to Public Read-Only, and a new custom index has.
been created for the Type__c field. There are more than 5 million Opportunity records within the environment.
and a considerable amount of the existing records have NULL values for the picklist Which technique should the developer implement to maximize performance when querying NULL values?

Question46: A Lightning Component has a section that displays some information about an Account and it works well on the desktop, but users have to scroll horizontally to see the Description field output on their mobile devices and tablets.

Which option has the changes to make the component responsive for mobile and tablet devices?

Question47: Which are relevant practices while analyzing the timeline of different types of transactions in the execution overview panel? (Choose two.)

Question48: A developer is creating unit tests for code that makes SOAP web service callouts. The developer needs to insert some test data as a part of the unit tests setup.
What are three actions to enable this functionality? (Choose three.)

Question49: If a developer wanted to display error messages with the standard Salesforce Ul styling, what would they use?

Question50: An Apex class does not achieve expected code coverage. The testSetup method explicitly calls a method in the Apex class. How can the developer generate the code coverage?

Question51: Which statement is true regarding the use of user input as part of a dynamic SOQL query?

Question52: A company has a custom component that allows users to search for records of a certain object type by invoking an Apex Controller that returns a list of results based on the user's input, when the search Is completed, a searchComplete event is fired, with the results put in a results attribute of the event. The component is designed to be used within other components and may appear on a single page more than once.
What is the optimal code that should be added to fire the event when the search has completed?

Question53: A developer must create a custom pagination solution for accessing approximately 2000 records and displaying 50 records on each page. Data from Salesforce will be accessed via an API and not via Apex.
How can the developer meet these requirements? (Choose two.)

Question54: A developer created a Lightning web component that uses a Lightning-record-edit-form to collect information about Leads. Users complain that they only see one error message at a time when they save a Lead record.
Which best practice should the developer use to perform the validations, and allow more than one error message to be displayed simultaneously?

Question55: Consider the following code snippet, depicting an Azure component:

Which two interfaces can the developer implement to make the component available as a quick action?
Choose 2 answers

Question56: Which two objects can be inserted in the same transaction? (Choose two.)

Question57: A company has a custom object, Sales Demo Request, that has a lookup to an Opportunity. It is required that a Sales Demo Request record be created when an Opportunity's Probability is greater than 50%. What is the optimal way to automate this?

Question58: What is the transaction limit for SOQL queries?

Question59: When calling a RESTful web service, a developer receives a JSON payload that has a data hierarchy that is nested three levels deep. How can the developer describe the external data?

Question60: Universal Containers wants to be able to bring up an Account detail page and view a table of containers currently being rented. The user wants to be able to dick on a container In the table and quickly edit and save the location of the container.
In addition to this, the page should have a section that shows the location of each container on a map. Universal Containers wants the map to re-render whenever the location of a container is changed.
What can a developer use to accomplish this task?

Question61: A company represents their customers as Accounts that have an External ID field called Customer_Number__c. They have a custom Order (Order__c) object, with a Lookup to Account, to represent Orders that are placed in their external order management system (OMS). When an order is fulfilled in the OMS, a REST call to Salesforce should be made that creates an Order record in Salesforce and retates it to the proper Account. What is the optimal way to implement this?

Question62: A company decides that every time an Opportunity is created, they want to create a follow up Task and assign it to the Opportunity Owner.
What should a developer use to implement the requirements?

Question63: [FIND 'map' IN ALL FIELDS RETURNING Account (Id, Name), Contact, Opportunity, Lead] What is a valid return type for th|e following SOSL query?

Question64: A developer is using a third-party JavaScript library to create a custom user interface in Visualforce. The developer needs to use JavaScript to get data from a controller method in response to a user action.
How can the developer accomplish this?

Question65: Consider the following code snippet:

A developer needs to built an interactive Aura component that responds to the user's input by hiding or showing sections according the user preferences.
What are two best practices the developer can implement to hide or show the powerVserView and s-rar.daraVserView inner components, based on the value of the attribute isPowexUser?
Choose 2 answers
A)

B)

C)

Question66: A developer is tasked with creating a Lightning web component that allows users to create a Case for a selected product, directly from a custom Lightning page. The input fields in the component are displayed in a non-linear fashion on top of an image of the product to help the user better understand the meaning of the fields.
Which two components should a developer use to implement the creation of the Case from the Lightning web component?
Choose 2 answers

Question67: A company requires an external system to be notified whenever an account is updated.

What LimitException could the following code trigger?

Question68: 1 Contact con = new Contact ( LastName =fSmith', Department = fAdminT)
2 insert con;
3 Contact insertedContact=[select Name from Contact where id=icon.Id];
4 Savepoint sp_admin = Database.setSavepoint();
5 con.Department = fHRf;
6 update con;
7 Database.rollback(sp_admin);
8 System.debug(Limits.getDmlStatements 0);
Given the following code, what value will be output in the logs by line #8?

Question69: What is a benefit of JavaScript remoting over Visualforce Remote Objects?

Question70: What is a potential design issue with the following code?

Question71: In a VisualForce page with a VisualForce component that has rendered set to false when the page loads, how can a developer ensure it will show on a re-render?

Question72: A developer has a page with two extensions overriding the Standard controller for Case.

What will happen when a user clicks the command button?

Question73: A company has many different unit test methods that create Account records as part of their data setup. A new required field was added to the Account and now all of the unit tests fail. What is the optimal way for a developer to fix the issue?

Question74: What should be added to the setup, in the location indicated, for the unit test above to create the controller extension for the test?
A)

B)

C)

D)

Question75: A developer is building a Lightning web component that searches for Contacts and must communicate the search results to other Lightning web components when the search completes.
What should the developer do to implement the communication?

Question76: A company notices that their unit tests in a test class with many methods to create many records for prerequisite reference data are slow. What can a developer to do address the issue?

Question77: A company processes Orders within their Salesforce instance. When an Order's status changes to 'Paid' it must notify the company's order management system (OMS). The OMS exposes SOAP web service endpoints to listen for when to retrieve the data from Salesforce. What is the optimal method to implement this?

Question78: A developer i$ tasked Dy Unversai Containers to build out a system to track the container repair process. Containers should be tracked as they move through the repair process, starting when a customer reports an issue and ending when the container is returned to the customer.
Which solution meets these business requirements while following best practices?

Question79: A developer is building a Lightning web component that displays quantity, unit price, and the total for an order line item. The total is calculated dynamically as the quantity multiplied by the unit price.

What must be added to display the total?

Question80: Which technique can run custom logic when a Lightning web component is loaded?

Question81: A developer needs to design a custom object that will be integrated into a back-end system.
What should the developer do to ensure good data quality and to ensure that data imports, integrations, and searches perform well? (Choose two.)

Question82: The REST API___________.

Question83: Universal Containers needs to integrate with their own, existing, internal custom web application. The web application accepts JSON payloads, resizes product images, and sends the resized images back to Salesforce.
What should the developer use to implement this integration?

Question84: A Visualforce page loads slowly due to the large amount of data it displays. Which strategy can a developer use to improve the performance?

Question85: Global with sharing class MyRemoter { public String accountName { get; set; } public static Account account { get; set; } public AccountRemoter(} {} @RemoteAction global static Account getAccount (String acccuntName) { account = [SELECT Id, Name, NumberOfEmployees FROM Account WHERE Name = :accountName]; return account; } } Consider the Apex class above that defines a RemoteAction used on a Visualforce search page. Which code snippet will assert that the remote action returned the correct Account?

Question86: A company has a Request__c object that has a lookup to the Opportunity object and a custom field. Status__c, with values of Open,' Closed, and Invalid.' An Opportunity should not be allowed to be deleted if there are any Request__c records related to it that have a Status__c value of Open or 'Closed.' what is the optimal way to enforce the requirement to prevent deletion?

Question87: Refer to re code segment above.

When following best practices for writing Apex taggers, which two lots are wrong or cause for concern? Choose 2 answers

Question88: @isTest static void testAccountUpdate() { Account acct = new Account({Name = 'Test'); acct.Integration Updated_c = false; insert acct; CalloutUtil.sendAccountUpdate (acct.Id); Account acctAfter = [SELECT Id, Integration Updated_c FROM Account WHERE Id = :acct.Id] [0]; System.assert(true, acctAfter.Integration_Updated_c); } The test method above calls a web service that updates an external system with Account information and sets the Account's Integration_Updated__c checkbox to True when it completes. The test fails to execute and exits with an error: "Methods defined as TestMethod do not support Web service callouts." What is the optimal way to fix this?

Question89: A developer wants to use an Aura Component with a Custom Action.
What should be considered in order to do this?

Question90: When developing a Lightning web component, which setting displays lightning-layout-items in one column on small devices, such as mobile phones, and in two columns on tablet-size and desktop-size screens?

Question91: Universal Containers needs to integrate with a Heroku service that resizes product images submitted by users.
What are two alternatives to implement the integration and protect against malicious calls to Heroku app's endpoint? Choose 2 answers

Question92: As part of point-to-point integration, a developer must call an external web service which, due to high demand, takes a long time to provide a response. As part of the request, the developer must collect key inputs from the end user before making the callout.
Which two elements should the developer use to implement these business requirements?
Choose 2 answers

Question93: What are the ways a developer can create test data of Contacts? (Choose two.)

Question94: There are user complaints about slow render times of a custom data table within a visualforce page that loads thousands of Account records at once.
What can a developer do to help alleviate such issues?

Question95: During the Visualforce Page execution, what step follows immediately after "Evaluate constructors on controller and extensions"?

Question96: A developer wants to call an Apex Server-side Controller from a Lightning Aura Component. What are two limitations to the data being returned by the Controller? Choose 2 answers

Question97: Which method should be used to convert a Date to a String in the current user's locale?

Question98: As part of a custom development, a developer creates a Lightning Component to show how a particular opportunity progresses over time. The component must display the date stamp when any of the following fields change:
* Amount Probability, Stage, or Close Date
What is the most efficient way to Query such information?

Question99: A developer wrote an Apex class to make several callouts to an external system.
If the URLs used in these callouts will change often, which feature should the developer use to minimize changes needed to the Apex class?

Question100: A Visualforce Page throws an Attempt to dereference a null object error for a Contact. What change In the controller will fix the error?

Question101: A company accepts orders for customers in their enterprise resource planning (ERP) crder__c records with a lookup field to Account. The Account object has an External ID field, ERP_Customer_ID__c.
What should the integration use to create new Order__c records that will automatically be related to the correct Account?

Question102: The Contact object has a custom field called "Zone." Its data type is "Text" and field length is 3. What is the outcome after executing the following code snippet in the org?

Question103: A developer wrote an Apex method to update a list of Contacts and wants to make it available for use by Lightning web components.
Which annotation should the developer add to the Apex method to achieve this?

Question104: Where in a query can you use Geolocation and Distance? (Choose two.)

Question105: What is the transaction limit on the number of Apex jobs added to the queue?

Question106: A developer receives the exception 'SOQL query not selective enough' when performing a query on an object with a large amount of dat a. Which step should be taken to resolve the issue?

Question107: A developer creates a Lightning web component to allow a Contact to be quickly entered- However, error messages are not displayed.

Which component should the developer add to the form to display error messages?

Question108: What is the transaction limit for the number of records per DML statement?

Question109: Within the System.Limit class, what would you call to get the total limit you can call in a single transaction?

Question110: When developing a Visualforce page that will be used by a global organization that does business in many languages and many currencies, which feature should be used? (Choose three.)

Question111: A developer is integrated with a legacy on-premises SQL database.
What should the developer use to ensure the data being integrated is matched to the right records in Salesforce?

Question112: What is the best practice to initialize a Visualforce page in a test class?

Question113: A developer writes the following code:

While testing the code, the developer receives the following error message: System.CalloutException : You have uncommitted work pending What should the developer do? (Choose two.)

Question114: A company has code to update a Request and Request Lines and make a callout to their external ERP system's REST endpoint with the updated records.

The CalloutUtil. makeRestCallout fails with a 'You have uncommitted work pending. Please commit or rollback before calling out' error. What should be done to address the problem?

Question115: The Contact object in an org is configured with workflow rules that trigger field updates. The fields are not updating, even though the end user expects them to. The developer creates a debug log to troubleshoot the problem.
What should the developer specify in the debug log to see the values of the workflow rule conditions and debug the problem?

Question116: Consider the code above.

When a user dicks on the Link of a Contact's name, what happens'

Question117: How long is field history retained?

Question118: Which three Visualforce components can be used to initiate Ajax behavior to perform partial page updates? Choose 3 answers

Question119: Which use case is an appropriate fit for the future asynchronous Apex method? (Choose two.)

Question120: A developer is creating a page in App Builder that will be used in the Salesforce mobile app.
Which two practices should the developer follow to ensure the page operates with optimal performance?
Choose 2 answers

Question121: A developer writes a lightning web component that displays a dropdown list of all custom objects in the org from which a user will select Apex method prepares and returns data to the component.
What should the developer do to determine which objects to include m the response?

Question122: Which statement should be used to allow some of the records in a list of records to be inserted if others fail to be inserted?

Question123: What is the transaction limit on the max timeout for all callouts?

Question124: A custom field Exec_Count_c of type Number is created on an Account object. An account record with value of "1" for a: Exec__Count_c is saved. A workflow field update is defined on the Exec_Count_c field, to increment its value every time an account record is created or updated. The following trigger is defined on the account:
trigger ExecOrderTrigger on Account (before insert, before update, after insert, after update){ for (Account accountlnstance: Trigger.New){ if (Trigger . isBefore){ accountlnstance Exec_Count_c += 1; } System, debug (accountlnstance.Exec_Count_c); } }

Question125: <lightning: layout multipleRows="true"> <lightning: layoutItem size="12">{!v.account.Name} </flighting: layoutitem> <lightning:layoutitem 3ize="12">{!v. account .AccountNumber} </lighting: layoutitem> <lightning: layoutitem size="12">{!v.account. Industry} </lighting: layoutitem> </lightning: layout> Refer to the component code above. The information displays as expected (in three rows) on a mobile device. However, the information is not displaying as desired (in a single row) on a desktop or tablet. Which option has the correct component changes to display correctly on desktops and tablets?

Question126: Refer to the code snippet below:

When a Lightning web component is rendered, a list of opportunity that match certain criteria should be retrieved from the database and displayed to the end-user.
Which three considerations must the developer implement to make the fetchOpps method available within the Lightning web component?

Question127: A developer notices the execution of all the test methods in a class takes a long time to run, due to the initial setup of ail the test data that is needed to perform the tests.
What should the developer do to speed up test execution?

Question128: The following code segment is railed from a Trigger handler class from the Opportunity trigger:

Which two changes should improve this code and make it more efficient? Choose 2 answers

Question129: A developer is trying to decide between creating a Visualforce component or a Lightning component for a custom screen. Which functionality consideration impacts the final decision?

Question130: Universal Containers requested the addition of a third-party Map widget to an existing Lightning web component.
Which two actions should the developer take to implement this requirement?
Choose 2 answers

Question131: Choose the correct definition for <apex:actionFunction>.

Question132: A developer is writing unit tests for the following method:

Which assertion would be used in a negative test case?

Question133: A company uses an external system to manage its custom account territory assignments. Every quarter, millions of Accounts may be updated in Salesforce with new Owners when the territory assignments are completed in the external system. What is the optimal way to update the Accounts from the external system?

Question134: A developer is building a Lightning web component that retrieves data from Salesforce and assigns it to the record property.

What must be done in the component to get the data from Salesforce?
A)

B)

C)

D)

Question135: A developer created a class that implement he Queueable interface, as follows:
As part of the deployment process, the developer is asked to create a corresponding test class.
Which two actions should the developer take to successfully execute the test class?
Choose 2 answers

Question136: A developer is asked to find a way to store secret data with an ability to specify which profiles and users can access which secrets.
What should be used to store this data?